<?php
// +----------------------------------------------------------------------
// | 管理
// +----------------------------------------------------------------------
declare (strict_types = 1);

namespace app\table\controller;

use app\mxadmin\AdminBase;
use app\table\service\ActionService;
use app\core\Res;

class Action extends AdminBase
{
    /**
     * 视图
     * @return \think\response\View
     */
    public function index()
    {
        return view();
    }

    /**
     * 视图
     * @return \think\response\View
     */
    public function addview()
    {
        return view();
    }

    /**
     * 视图
     * @return \think\response\View
     */
    public function modelview()
    {
        return view();
    }

    /**
     * 视图
     * @return \think\response\View
     */
    public function seltableview()
    {
        return view();
    }

    /**
     * 视图
     * @return \think\response\View
     */
    public function modelfieldview()
    {
        return view();
    }

    /**
     * 视图
     * @return \think\response\View
     */
    public function titleview()
    {
        return view();
    }

    /**
     * 视图
     * @return \think\response\View
     */
    public function titleaddview()
    {
        return view();
    }

    /**
     * 列表
     * @return \think\response\View
     */
    public function list()
    {
        $params = input('param.');
        $list=ActionService::list($params);
        return $this->result($list);
    }

    /**
     * 列表
     * @return \think\response\View
     */
    public function modellist()
    {
        $params = input('param.');
        $list=ActionService::modelList($params);
        return $this->result($list);
    }

    /**
     * 列表
     * @return \think\response\View
     */
    public function modelfieldlist()
    {
        $params = input('param.');
        $list=ActionService::modelFieldList($params);
        return $this->result($list);
    }

    /**
     * 列表
     * @return \think\response\View
     */
    public function titlelist()
    {
        $params = input('param.');
        $list=ActionService::TitleList($params);
        return $this->result($list);
    }

    /**
     * 添加编辑
     * @return \think\response\View
     */
    public function addaction()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=ActionService::addAction($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }

    /**
     * 添加编辑
     * @return \think\response\View
     */
    public function addmodel()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=ActionService::addModel($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }

    /**
     * 添加编辑
     * @return \think\response\View
     */
    public function addtitle()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=ActionService::addTitle($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }

    /**
     * 添加编辑
     * @return \think\response\View
     */
    public function tbstatus()
    {
        if (request()->isPost()){
            $params = input('param.');
            $list=ActionService::tbStatus($params);
            if ($list['code']==1) {
                return $this->success($list['msg']);
            } else {
                return $this->error($list['msg']);
            }
        }
    }

    /**
     * 操作设置删除
     * @return \think\response\View
     */
    public function titledel()
    {
        $params = input('param.');
        $list=ActionService::titleDel($params);
        return $this->success('删除成功');
    }

    /**
     * 请求方式列表
     * @return \think\response\View
     */
    public function actiontype()
    {
        $list=Res::getConfig('cfg.action');
        return $this->result($list);
    }
    
   
    /**
     * 请求类型列表
     * @return \think\response\View
     */
    public function actiontitle()
    {
        $list=Res::getConfig('cfg.actiontitle');
        return $this->result($list);
    }

    /**
     * 操作类型列表
     * @return \think\response\View
     */
    public function actiontitletype()
    {
        $list=Res::getConfig('cfg.actiontitletype');
        return $this->result($list);
    }

    
}
